<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="How Can I Add a Source Deduplication User to sudoers? (Applicable to the Linux OS)">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="EN-US_TOPIC_0000001792390228">
<meta name="DC.Language" content="en-us">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>How Can I Add a Source Deduplication User to sudoers? (Applicable to the Linux OS)</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="EN-US_TOPIC_0000001792390228"></a><a name="EN-US_TOPIC_0000001792390228"></a>

<h1 class="topictitle1">How Can I Add a Source Deduplication User to sudoers? (Applicable to the Linux OS)</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_p183483913313">If ProtectAgent is installed in automatic push mode, <span class="uicontrol" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_uicontrol109791574319"><b>User Type</b></span> is <span class="uicontrol" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_uicontrol139797571032"><b>Super administrator</b></span>, and source deduplication is required, perform operations in this section to add the source deduplication user to <strong id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_b198498455467">sudoers</strong> before initial backup. This section uses EulerOS as an example.</p>
<div class="section" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_section175941115163111"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_ol122521212317"><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li12252102115312"><span>Log in to the agent host as user <strong id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_b12911736114214">root</strong>.</span></li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li1296882714311"><span>Run the following command to search for the directory of the <strong id="EN-US_TOPIC_0000001792390228__b138352016185513">sudoers</strong> configuration file:</span><p><pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen2925152217527">whereis sudoers</pre>
<p id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_p82051743122320">Information similar to the following is displayed. <strong id="EN-US_TOPIC_0000001792390228__b6684141875520">/etc/sudoers</strong> is the directory of the <strong id="EN-US_TOPIC_0000001792390228__b1368411814552">sudoers</strong> configuration file.</p>
<pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen203173536238">sudoers: <strong id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_b18409559152516">/etc/sudoers</strong> /etc/sudoers.d /uer/share/man/man5/sudoers.5.gz</pre>
</p></li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li963520185474"><span>Run the following command to query the permission on the <strong id="EN-US_TOPIC_0000001792390228__b2875202111558">sudoers</strong> configuration file:</span><p><pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen2061215122712">ll /etc/sudoers</pre>
<p id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_p1395722592712">If information similar to the following is displayed, user <strong id="EN-US_TOPIC_0000001792390228__b172211244552">root</strong> has only the read-only permission on the <strong id="EN-US_TOPIC_0000001792390228__b15722132416551">sudoers</strong> configuration file. In this case, perform <a href="#EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li1967213198527">4</a> to grant the write permission on the configuration file to user <strong id="EN-US_TOPIC_0000001792390228__b6722152465512">root</strong>. If user <strong id="EN-US_TOPIC_0000001792390228__b81501134205512">root</strong> has the write permission on the configuration file, go to <a href="#EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li1783801718592">5</a>.</p>
<pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen5894174019277">-r--r-----. 1 root root 20724 Nov 19 21:04 /etc/sudoers</pre>
</p></li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li1967213198527"><a name="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li1967213198527"></a><a name="en-us_topic_0000001608686382_li1967213198527"></a><span>Run the following command to change the permission on the <strong id="EN-US_TOPIC_0000001792390228__b20852194045518">sudoers</strong> configuration file:</span><p><pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen2141552105214">chmod u+w /etc/sudoers</pre>
</p></li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li1783801718592"><a name="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li1783801718592"></a><a name="en-us_topic_0000001608686382_li1783801718592"></a><span>Run the following commands to back up the source file:</span><p><pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen205131331105917">mkdir /etc/backup_sudoers</pre>
<pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen21174444479">cp /etc/sudoers /etc/backup_sudoers</pre>
</p></li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li4145165012521"><a name="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li4145165012521"></a><a name="en-us_topic_0000001608686382_li4145165012521"></a><span>Run the following command to open the <strong id="EN-US_TOPIC_0000001792390228__b89161354115515">sudoers</strong> configuration file:</span><p><pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen92963290535">vim /etc/sudoers</pre>
</p></li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li994215063110"><span>If the configuration file contains the <span class="parmname" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_parmname10174344172510"><b>Defaults requiretty</b></span> field, perform this step. Otherwise, no further action is required.</span><p><div class="notice" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_note174109293718"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_p84110291713">Modify the configuration file in strict compliance with the following requirements. Otherwise, the source deduplication function may be unavailable or the <strong id="EN-US_TOPIC_0000001792390228__b434015916565">sudo</strong> command may fail to be executed.</p>
</div></div>
<ul id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_ul1075815385454"><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li47581238144518">Method 1: Delete the <span class="parmname" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_parmname13796151318468"><b>Defaults requiretty</b></span> field.</li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li3953715144612">Method 2: Add the source deduplication user to <strong id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_b7549597388">sudoers</strong>.<ul id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_ul1930163133910"><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li322843014419">To perform source deduplication for VMware, add the VMware DataTurbo user (username: <strong id="EN-US_TOPIC_0000001792390228__b16813184125713">VMDataTurbo</strong>) to the configuration file.<pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen17383131323011">Defaults:VMDataTurbo !requiretty</pre>
</li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li13228230164411">To perform source deduplication for another application, add the DataTurbo user (username: <strong id="EN-US_TOPIC_0000001792390228__b5204204755715">data_turbo_account</strong>) corresponding to the application to the configuration file.<pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen0598122863010">Defaults:data_turbo_account !requiretty</pre>
</li></ul>
</li></ul>
</p></li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li11391140173419"><a name="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li11391140173419"></a><a name="en-us_topic_0000001608686382_li11391140173419"></a><span>If you have performed <a href="#EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li1967213198527">4</a> to modify the permission on the <strong id="EN-US_TOPIC_0000001792390228__b17894111245917">sudoers</strong> configuration file, perform this step to delete the write permission on the file. Otherwise, skip this step.</span><p><pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen27863619358">chmod u-w /etc/sudoers</pre>
</p></li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li79011641162019"><span>View the configuration file to check whether the modification is successful.</span><p><pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen83592506128">cat /etc/sudoers</pre>
<ul id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_ul1215921062014"><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li12370814142619">If the modification fails, roll back the configuration file. After confirming that the rollback is successful, repeat <a href="#EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li4145165012521">6</a> to <a href="#EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li11391140173419">8</a>.<pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen247405762119">cp /etc/backup_sudoers/sudoers /etc/sudoers
cat /etc/sudoers</pre>
</li><li id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_li0454155172211">If the modification is successful, delete the backup file.<pre class="screen" id="EN-US_TOPIC_0000001792390228__en-us_topic_0000001608686382_screen129061154233">rm -fr /etc/backup_sudoers</pre>
</li></ul>
</p></li></ol>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">Copyright &copy; Huawei Technologies Co., Ltd.</div></body>
</html>